package com.start.platform.core.vo;

import com.alibaba.fastjson2.JSONObject;
import com.start.platform.core.entity.StartPlatformFans;
import com.start.platform.core.entity.StartPlatformUserEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.beans.BeanUtils;

@Data
public class StartPlatformUserInfo extends StartPlatformFans {
    @Schema(name = "用户原始信息")
    private JSONObject srcUserInfo;
    @Schema(name = "是否注册用户")
    private boolean isRegister;

    public static StartPlatformUserInfo create(StartPlatformUserEntity entity, JSONObject srcUserInfo) {
        StartPlatformUserInfo platformUserInfo = new StartPlatformUserInfo();
        BeanUtils.copyProperties(entity, platformUserInfo);
        platformUserInfo.setSrcUserInfo(srcUserInfo);
        return platformUserInfo;
    }
}
